package org.csu.onlineedubackend.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.PropertySource;

import lombok.Data;

@Configuration
@EnableConfigurationProperties
public class AppConfig {

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    @Bean
    @ConfigurationProperties(prefix = "spark.api")
    public SparkApiConfig sparkApiConfig() {
        return new SparkApiConfig();
    }

    @Data
    public static class SparkApiConfig {
        private String url;
        private String apiKey;
        private String apiSecret;
        private String appId;
        private String model;
        private Integer maxTokens;
        private Float temperature;
    }
} 